<template>
    <div class="content">
        <form action="#">
            <div>
                账号:<input type="text" v-model="username">
            </div>
            <div>
                密码: <input type="password" v-model="password">
            </div>
            <div>
                邮箱: <input type="email" v-model="email">
            </div>
            <input type="submit" value="注册" @click="rejest">
        </form>
    </div>
</template>
<script setup>
import { useRouter } from 'vue-router'
import { ref } from 'vue'
const username = ref('')
const password = ref('')
const email = ref('')
const router = useRouter()
const rejest = () => {
    //本地保存数据
    window.localStorage.setItem('userInfo', JSON.stringify({
        username: username.value,
        password: password.value,
        email: email.value
    }))
    router.push({
        path: "/login",
        query: {
            username: username.value,
            password: password.value,
            email: email.value
        }
    })
}
</script>
<style scoped>
.content {
    margin: auto;
    text-align: center;
}
</style>